/**
 * @fileOverview
 * Checkbox 封装，直接 onChange 布尔
 * @author iNahoo
 * @since 2022/3/6.
 */

import React, { useCallback } from 'react';
import { Checkbox } from 'antd';

const BooleanCheckbox = props => {
  const {
    onChange
  } = props;

  const changeHandler = useCallback((e) => {
    onChange && onChange(e.target.checked);
  }, [onChange]);

  return (
    <>
      <Checkbox onChange={changeHandler}/>
    </>
  );
};

export default BooleanCheckbox;
